package com.roadjava.rbac;

import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.jboss.logging.MDC;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.util.UUID;

@SpringBootApplication
@EnableScheduling
@EnableTransactionManagement
@Slf4j
@MapperScan("com.roadjava.rbac.mapper")
public class RbacApp {
    public static void main(String[] args) {
        SpringApplication.run(RbacApp.class, args);

    }

    @Bean
    public RestHighLevelClient restHighLevelClient() {
        return new RestHighLevelClient(RestClient.builder(
                 HttpHost.create("http://10.13.49.133:9200")
        ));
    }
}